<template>
	<view class="myBox" style="display: flex;flex-direction: column;">
		<view class="topTwo">
			<image :src="httpUrl+'/app/file/viewFile?fileId='+userInfo?.avatarId" style="width:90rpx;height:90rpx;margin: 0 10rpx 0 32rpx;border-radius: 50rpx;" mode="aspectFill">
			</image>
			<view style="display: flex;flex-direction: column;justify-content: flex-start;align-items: flex-start;">
				<view style="display: flex;justify-content:center;align-items: center;">
					<view class="userName"> {{userInfo?.userName}}</view>
					<image v-if="userInfo?.partnerLevel?.level==1" src="@/static/icons/my/partner1.png" style="width:40rpx;height:40rpx;margin: 0 6rpx  0 20rpx;"></image>
					<image v-else-if="userInfo?.partnerLevel?.level==2" src="@/static/icons/my/partner2.png" style="width:40rpx;height:40rpx;margin: 0 6rpx 0 20rpx;"> </image>
					<image v-else-if="userInfo?.partnerLevel?.level==3" src="@/static/icons/my/partner3.png" style="width:40rpx;height:40rpx;margin: 0 6rpx 0 20rpx;"> </image>

					<image v-if="userInfo?.vipFlag=='Y'" src="@/static/icons/my/vip.png" style="width:40rpx;height:40rpx;margin: 0 6rpx  0 20rpx;"></image>

				</view>
				<!-- <view class="topId">
					<image @tap="edit=!edit" src="@/static/img/qianming.png" style="width:40rpx;height:40rpx;margin-right: 24rpx;"></image>
					<text style="color: #8C8C8C;font-size: 28rpx;font-weight: bold;">签名:</text>
					<text v-if="!edit" style="margin-left: 12rpx;color: #8C8C8C;font-size: 28rpx;font-weight: bold;padding-left: 10rpx;">{{userInfo?.appUser?.autograph}}</text>
					<input @confirm="confirm" @blur="confirm" style="margin-left: 12rpx;color: #8C8C8C;font-size: 28rpx;font-weight: bold;background: #fff;width: 70%;padding-left: 10rpx;" v-model="autograph" focus />
				</view> -->
			</view>
		</view>
		<view style="flex: 1;overflow: auto;">
			<view class="renzheng">
				<view class="renzhengImg" style="width: 200rpx;background: url('../../static/img/zhizhizhzi.png') no-repeat;background-size: cover;">
					<view class="renzhengText" style="color: #6b64d3;margin-left: 91rpx;text-align: center;line-height: 48rpx;">
						{{userInfo?.flagQualifications?.name}}
					</view>
				</view>

				<view class="renzhengImg" style="background: url('../../static/img/xinyongfen2.png') no-repeat;background-size: cover;">
					<view class="renzhengText" style="color: #40afff;;margin-left: 91rpx;text-align: center;line-height: 48rpx;">
						{{userInfo?.credit}}
					</view>
				</view>

				<view class="renzhengImg" style="background: url('../../static/img/baozhengjin2.png') no-repeat;background-size: cover;">
					<view class="renzhengText" style="color: #ffcc40;;margin-left: 91rpx;text-align: center;line-height: 48rpx;">
						{{userInfo?.bondAmount>=10000?Math.floor(userInfo?.bondAmount/10000)+'万+':userInfo?.bondAmount}}
					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script setup lang="ts">
	import { queryUserInfo, loginCheck,queryUserByUserId } from '@/utils/api/userInfo.ts'
	import { onShow,onLoad } from '@dcloudio/uni-app'
	import { ref } from 'vue'
	
	const httpUrl = getApp().globalData.baseUrl
	const userInfo = ref()

	const doQueryUserInfoById = async (userId) => {
		const userRes = await queryUserByUserId({data:{userId:userId}})
		userInfo.value = userRes.data
		
	}

 
	onLoad((option)=>{
		const userId=option.userId
		loginCheck().then(res => {
			doQueryUserInfoById(userId)
		})
	})
	
</script>

<style lang="scss" scoped>
	.myBox {
		background: url("@/static/img/wode.png");
		width: 750rpx;
		// height: 610rpx;
		background-repeat: no-repeat;
		background-size: 100% 100%;
		// padding-top: 75rpx;
	}

	.top {}

	.topTwo {
		display: flex;
		align-items: center;
		padding: var(--status-bar-height) 1vh 0 0;
		// padding-top: 20px;
		position: relative;
	}

	.userName {
		height: 50rpx;
		font-weight: 700;
		font-size: 30rpx;
		color: #262626;
		line-height: 54rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.topId {
		display: flex;
		align-items: center;
		margin: 16rpx 0 32rpx 66rpx;
		font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
		font-weight: normal;
		font-size: 28rpx;
		color: #8C8C8C;
		line-height: 42rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}

	.renzheng {
		width: 702rpx;
		height: 82rpx;
		background: rgba(255, 255, 255, 0.6);
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 12rpx 24rpx 12rpx 24rpx;
		border: 2rpx solid rgba(255, 255, 255, 0.3);
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.renzhengImg {
		width: 200rpx;
		height: 48rpx;
	}
</style>